﻿@namespace MudBlazor.UnitTests.TestComponents

<MudDataGrid Items="@_items">
    <Columns>
        <Column T="Model" Field="@nameof(Model.Name)" />
        <Column T="Model" Field="@nameof(Model.Age)" />
        <Column T="Model" Field="@nameof(Model.Status)">
            <FooterTemplate>
                Total Records: @_items.Count()
            </FooterTemplate>
        </Column>
    </Columns>
    <Footer>
        <FooterCell T="Model">
            Names: @(string.Join(",", _items.Select(x => x.Name)))
        </FooterCell>
    </Footer>
</MudDataGrid>

@code {
    private IEnumerable<Model> _items = new List<Model>()
    {
        new Model("Sam", 56, Severity.Normal), 
        new Model("Alicia", 54, Severity.Info), 
        new Model("Ira", 27, Severity.Success),
        new Model("John", 32, Severity.Warning)
    };

    public record Model (string Name, int Age, Severity Status);
}
